from django import forms
from django.forms import ModelForm
from models import *

class FormEvento(ModelForm):
	datahora = forms.DateTimeField(
        widget=forms.DateInput(format='%d/%m/%Y'),
        input_formats=['%d/%m/%y', '%d/%m/%Y'])
	
	categoria = forms.ModelChoiceField(queryset=Categoria.objects.all(), empty_label="Selecione")
	
	valor = forms.ModelChoiceField(queryset=Evento.objects.filter(categoriaid=1), empty_label="Selecione")
	valor2 = forms.ModelChoiceField(queryset=Evento.objects.filter(categoriaid=2), empty_label="Selecione")
	valor3 = forms.ModelChoiceField(queryset=Evento.objects.filter(categoriaid=3), empty_label="Selecione")

	class Meta:
		model = Evento
		fields = ('datahora', 'valor')